//
//  NetworkTool+Status.swift
//  CFZWeiBo
//
//  Created by Cedric Zheng on 29/11/2016.
//  Copyright © 2016 Cedric Zheng. All rights reserved.
//

import Foundation

extension NetworkTool {
    
    func requestStatus(access_token: String?, since_id: String = "0", max_id: String = "0", callBack: @escaping (_ responseObject: Any?)->()) {
        
        guard let access_token = access_token else {
            callBack(nil)
            return
        }
        
        let parameters = ["access_token": access_token,
                          "since_id": since_id,
                          "max_id": max_id]
        
        request(url: "https://api.weibo.com/2/statuses/home_timeline.json", parameters: parameters, method: "GET", callBack: {
            (responseObject) in
            callBack(responseObject)
        })
    }

}
